package com.ruoyi.base.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * 订单对象 orders
 * 
 * @author 刘大理
 * @date 2025-07-03
 */
//public class Orders extends BaseEntity
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Orders
{
    private static final long serialVersionUID = 1L;

    /** 订单唯一标识 */
    @TableId(value = "id", type = IdType.ASSIGN_ID) // 指定自增策略
    private String id;

    /** 商品名称 */
    @Excel(name = "商品名称")
    private String productName;
    @Excel(name = "门店名称")
    private String storeName;

    /** 购买数量 */
    @Excel(name = "购买数量")
    private Long quantity;

    /** 商品单价 */
    @Excel(name = "商品单价")
    private BigDecimal unitPrice;

    /** 折扣率（如0.9表示9折） */
    private BigDecimal discount;

    /** 订单总价（含折扣前） */
    private BigDecimal totalPrice;

    /** 实际支付金额 */
    @NotNull(message = "订单金额不能为空")
    @DecimalMin(value = "0.01", message = "订单金额必须大于0")
    private BigDecimal paidPrice;

    /** 用户ID */
    @Excel(name = "用户ID")
    @NotBlank(message = "微信用户不能为空")
    private String userId;

    /** 微信订单号 */
    @Excel(name = "微信订单号")
    private String wechatOrderId;

    /** 支付状态（如已支付/未支付） */
    @Excel(name = "支付状态", readConverterExp = "如=已支付/未支付")
    private String paymentStatus;

    /** 是否删除（0-未删除，1-已删除） */
    private String isDeleted;

    /** 创建时间 */
    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")  // JSON 返回格式
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")  // Excel 导出格式
    private Date createdTime;

    /** 修改时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")  // JSON 返回格式
    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")  // Excel 导出格式
    private Date updatedTime;

    /** 店铺图片 */
    @Excel(name = "店铺图片")
    private String img;

    /** 联系方式 */
    @Excel(name = "联系方式")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "请输入正确的手机号")
    private String phone;

    /** 营业时间 */
    @Excel(name = "营业时间")
    private String businessHours;

    /** 门店地址 */
    @Excel(name = "门店地址")
    @NotBlank(message = "门店地址不能为空")
    private String address;

    /** 扩容 */
    @Excel(name = "扩容")
    private String extend;

    public void setId(String id) 
    {
        this.id = id;
    }

    public String getId() 
    {
        return id;
    }

    public void setProductName(String productName) 
    {
        this.productName = productName;
    }

    public String getProductName() 
    {
        return productName;
    }

    public void setQuantity(Long quantity) 
    {
        this.quantity = quantity;
    }

    public Long getQuantity() 
    {
        return quantity;
    }

    public void setUnitPrice(BigDecimal unitPrice) 
    {
        this.unitPrice = unitPrice;
    }

    public BigDecimal getUnitPrice() 
    {
        return unitPrice;
    }

    public void setDiscount(BigDecimal discount) 
    {
        this.discount = discount;
    }

    public BigDecimal getDiscount() 
    {
        return discount;
    }

    public void setTotalPrice(BigDecimal totalPrice) 
    {
        this.totalPrice = totalPrice;
    }

    public BigDecimal getTotalPrice() 
    {
        return totalPrice;
    }

    public void setPaidPrice(BigDecimal paidPrice) 
    {
        this.paidPrice = paidPrice;
    }

    public BigDecimal getPaidPrice() 
    {
        return paidPrice;
    }

    public void setUserId(String userId) 
    {
        this.userId = userId;
    }

    public String getUserId() 
    {
        return userId;
    }

    public void setWechatOrderId(String wechatOrderId) 
    {
        this.wechatOrderId = wechatOrderId;
    }

    public String getWechatOrderId() 
    {
        return wechatOrderId;
    }

    public void setPaymentStatus(String paymentStatus) 
    {
        this.paymentStatus = paymentStatus;
    }

    public String getPaymentStatus() 
    {
        return paymentStatus;
    }

    public void setIsDeleted(String isDeleted) 
    {
        this.isDeleted = isDeleted;
    }

    public String getIsDeleted() 
    {
        return isDeleted;
    }

    public void setCreatedTime(Date createdTime) 
    {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() 
    {
        return createdTime;
    }

    public void setUpdatedTime(Date updatedTime) 
    {
        this.updatedTime = updatedTime;
    }

    public Date getUpdatedTime() 
    {
        return updatedTime;
    }

    public void setImg(String img) 
    {
        this.img = img;
    }

    public String getImg() 
    {
        return img;
    }

    public void setPhone(String phone) 
    {
        this.phone = phone;
    }

    public String getPhone() 
    {
        return phone;
    }

    public void setBusinessHours(String businessHours) 
    {
        this.businessHours = businessHours;
    }

    public String getBusinessHours() 
    {
        return businessHours;
    }

    public void setAddress(String address) 
    {
        this.address = address;
    }

    public String getAddress() 
    {
        return address;
    }

    public void setExtend(String extend) 
    {
        this.extend = extend;
    }

    public String getExtend() 
    {
        return extend;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("productName", getProductName())
            .append("quantity", getQuantity())
            .append("unitPrice", getUnitPrice())
            .append("discount", getDiscount())
            .append("totalPrice", getTotalPrice())
            .append("paidPrice", getPaidPrice())
            .append("userId", getUserId())
            .append("wechatOrderId", getWechatOrderId())
            .append("paymentStatus", getPaymentStatus())
            .append("isDeleted", getIsDeleted())
            .append("createdTime", getCreatedTime())
            .append("updatedTime", getUpdatedTime())
            .append("img", getImg())
            .append("phone", getPhone())
            .append("businessHours", getBusinessHours())
            .append("address", getAddress())
            .append("extend", getExtend())
            .toString();
    }
}
